<template>
    <div>
      <center>
      <h1>博天产品管理后台</h1>
      </center>
      <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
          label="产品ID"
          width="180">
          <template slot-scope="scope">
            {{ scope.row.productId }}
          </template>
        </el-table-column>
        <el-table-column
          label="产品名称"
          width="180">
          <template slot-scope="scope">
            {{ scope.row.productName }}
          </template>
        </el-table-column>
        <el-table-column
          label="产品名称"
          width="180">
          <template slot-scope="scope">
            {{ scope.row.productName }}
          </template>
        </el-table-column>
        <el-table-column
          label="产品年利率"
          width="180">
          <template slot-scope="scope">
            {{ scope.row.productRate }}
          </template>
        </el-table-column>
        <el-table-column
          label="产品类型"
          width="180">
          <template slot-scope="scope">
            {{ scope.row.typeId }}
          </template>
        </el-table-column>
        <el-table-column
          label="产品额度"
          width="180">
          <template slot-scope="scope">
            {{ scope.row.productQuota }}
          </template>
        </el-table-column>
        <el-table-column
          label="产品可用时长"
          width="180">
          <template slot-scope="scope">
            {{ scope.row.productTime }}
          </template>
        </el-table-column>
        <el-table-column
          label="还款方式"
          width="180">
          <template slot-scope="scope">
            {{ scope.row.wayId }}
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button
              size="mini"
              @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
            <el-button
              size="mini"
              type="danger"
              @click="handleDelete(scope.$index, scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
</template>

<script>
import {productList} from '@/api/loan'
export default {
  data() {
    return {
      tableData: [],
    }
  },
  created() {
    this.list();
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    },
    list(){
      productList().then(res=>{
        var result=res.data;
        if (result.code==10000){
          this.tableData=result.data;
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
